<!DOCTYPE html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>图书馆人流量</title>
    <script src="./js/vue.js"></script>
    <style>
        #yj123{
            text-align: center;
        }
        .a{
            background-color: aliceblue;
            text-align: center;
        }
        .yj1{
            background-color: #99ffcc;
            font-size: bold; 
            text-align: center;
        }
        .yj2{
            background-color: #ffb6c1;
            height: 50px;
            text-align: center;
        }
        .yj3{
            height: 200px;
            width: 0em;
            background-color: #0cc;
            text-align: center;     
        }

    </style>
</head>

<body>
    <div id="app">
        <mycom :msg="msg" @my-event="yj"></mycom>
    </div>
    <script>
        var x = new Date().toLocaleString();
        var component1 = {
            props: ['msg'],
            data() {
                return {
                    commsg: '图书馆'
                }
            },
            template:  `
            <div id="yj123">
            <div>
                <div><table class="yj1">
                    <tr>
                        <td class="yj1"><strong>图书馆人流量</strong></td>
                        <td class="yj2"><a class="a">年</a>
                            <a class="a">月</a>
                            <a class="a">日</a>
                        </td>
                    </tr>
                    <tr class="yj3"><td colspan="2">这里是我的内容哟~欢迎来到我的图书馆</tr>
                    </table></div>
            </div>
        </div> 
        `,
            methods: {
                abc() {
                    this.$emit('my-event', this.commsg)
                }
            }
        }
        var vm = new Vue({
            el: '#app',
            data: {
                time:x
            },
            methods: {
                
            },
            components: {
                'mycom': component1
            }
        })
    </script>
</body>

</html>